﻿@using System.Globalization

<MudNumericField @ref="NumericField"
                 id="num-field-id"
                 Step="0.1M"
                 @bind-Value="Value"
                 Label="Numeric Input"
                 Variant="Variant.Outlined"
                 Margin="Margin.Dense"
                 Clearable="true"
                 Pattern="@(UsePattern ? "[0-9,.\\-]" : null)"/>

<MudSwitch @bind-Value="@UsePattern" Label="Use Pattern"/>

@code {
    public static string __description__ = "Render as Type Number or Text";

    [Parameter]
    public bool UsePattern { get; set; }

    public decimal Value { get; set; }

    public MudNumericField<decimal> NumericField { get; set; } = null!;
}
